// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#include <PySurfCompPrepAttributes.h>
#include <ObserverToCallback.h>
#include <stdio.h>
#include <Py2and3Support.h>

// ****************************************************************************
// Module: PySurfCompPrepAttributes
//
// Purpose:
//   Attributes for the SurfCompPrep operator.
//
// Note:       Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation:   omitted
//
// ****************************************************************************

//
// This struct contains the Python type information and a SurfCompPrepAttributes.
//
struct SurfCompPrepAttributesObject
{
    PyObject_HEAD
    SurfCompPrepAttributes *data;
    bool        owns;
    PyObject   *parent;
};

//
// Internal prototypes
//
static PyObject *NewSurfCompPrepAttributes(int);
std::string
PySurfCompPrepAttributes_ToString(const SurfCompPrepAttributes *atts, const char *prefix, const bool forLogging)
{
    std::string str;
    char tmpStr[1000];

    const char *surfaceType_names = "Closest, Farthest, Average";
    switch (atts->GetSurfaceType())
    {
      case SurfCompPrepAttributes::Closest:
          snprintf(tmpStr, 1000, "%ssurfaceType = %sClosest  # %s\n", prefix, prefix, surfaceType_names);
          str += tmpStr;
          break;
      case SurfCompPrepAttributes::Farthest:
          snprintf(tmpStr, 1000, "%ssurfaceType = %sFarthest  # %s\n", prefix, prefix, surfaceType_names);
          str += tmpStr;
          break;
      case SurfCompPrepAttributes::Average:
          snprintf(tmpStr, 1000, "%ssurfaceType = %sAverage  # %s\n", prefix, prefix, surfaceType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    const char *coordSystem_names = "Cartesian, Cylindrical, Spherical";
    switch (atts->GetCoordSystem())
    {
      case SurfCompPrepAttributes::Cartesian:
          snprintf(tmpStr, 1000, "%scoordSystem = %sCartesian  # %s\n", prefix, prefix, coordSystem_names);
          str += tmpStr;
          break;
      case SurfCompPrepAttributes::Cylindrical:
          snprintf(tmpStr, 1000, "%scoordSystem = %sCylindrical  # %s\n", prefix, prefix, coordSystem_names);
          str += tmpStr;
          break;
      case SurfCompPrepAttributes::Spherical:
          snprintf(tmpStr, 1000, "%scoordSystem = %sSpherical  # %s\n", prefix, prefix, coordSystem_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%sthetaStart = %g\n", prefix, atts->GetThetaStart());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sthetaStop = %g\n", prefix, atts->GetThetaStop());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sthetaSteps = %d\n", prefix, atts->GetThetaSteps());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sphiStart = %g\n", prefix, atts->GetPhiStart());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sphiStop = %g\n", prefix, atts->GetPhiStop());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sphiSteps = %d\n", prefix, atts->GetPhiSteps());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sstartRadius = %g\n", prefix, atts->GetStartRadius());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sendRadius = %g\n", prefix, atts->GetEndRadius());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sradiusSteps = %d\n", prefix, atts->GetRadiusSteps());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sxStart = %g\n", prefix, atts->GetXStart());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sxStop = %g\n", prefix, atts->GetXStop());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sxSteps = %d\n", prefix, atts->GetXSteps());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%syStart = %g\n", prefix, atts->GetYStart());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%syStop = %g\n", prefix, atts->GetYStop());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sySteps = %d\n", prefix, atts->GetYSteps());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%szStart = %g\n", prefix, atts->GetZStart());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%szStop = %g\n", prefix, atts->GetZStop());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%szSteps = %d\n", prefix, atts->GetZSteps());
    str += tmpStr;
    return str;
}

static PyObject *
SurfCompPrepAttributes_Notify(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    obj->data->Notify();
    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetSurfaceType(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid surfaceType value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Closest";
        ss << ", Farthest";
        ss << ", Average";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the surfaceType in the object.
    obj->data->SetSurfaceType(SurfCompPrepAttributes::SurfaceType(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetSurfaceType(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetSurfaceType()));
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetCoordSystem(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid coordSystem value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Cartesian";
        ss << ", Cylindrical";
        ss << ", Spherical";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the coordSystem in the object.
    obj->data->SetCoordSystem(SurfCompPrepAttributes::CoordinateSystem(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetCoordSystem(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetCoordSystem()));
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetThetaStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the thetaStart in the object.
    obj->data->SetThetaStart(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetThetaStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetThetaStart());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetThetaStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the thetaStop in the object.
    obj->data->SetThetaStop(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetThetaStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetThetaStop());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetThetaSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the thetaSteps in the object.
    obj->data->SetThetaSteps(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetThetaSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetThetaSteps()));
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetPhiStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the phiStart in the object.
    obj->data->SetPhiStart(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetPhiStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetPhiStart());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetPhiStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the phiStop in the object.
    obj->data->SetPhiStop(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetPhiStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetPhiStop());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetPhiSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the phiSteps in the object.
    obj->data->SetPhiSteps(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetPhiSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetPhiSteps()));
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetStartRadius(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the startRadius in the object.
    obj->data->SetStartRadius(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetStartRadius(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetStartRadius());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetEndRadius(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the endRadius in the object.
    obj->data->SetEndRadius(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetEndRadius(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetEndRadius());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetRadiusSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the radiusSteps in the object.
    obj->data->SetRadiusSteps(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetRadiusSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetRadiusSteps()));
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetXStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the xStart in the object.
    obj->data->SetXStart(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetXStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetXStart());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetXStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the xStop in the object.
    obj->data->SetXStop(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetXStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetXStop());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetXSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the xSteps in the object.
    obj->data->SetXSteps(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetXSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetXSteps()));
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetYStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the yStart in the object.
    obj->data->SetYStart(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetYStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetYStart());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetYStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the yStop in the object.
    obj->data->SetYStop(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetYStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetYStop());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetYSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the ySteps in the object.
    obj->data->SetYSteps(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetYSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetYSteps()));
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetZStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the zStart in the object.
    obj->data->SetZStart(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetZStart(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetZStart());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetZStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the zStop in the object.
    obj->data->SetZStop(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetZStop(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetZStop());
    return retval;
}

/*static*/ PyObject *
SurfCompPrepAttributes_SetZSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the zSteps in the object.
    obj->data->SetZSteps(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
SurfCompPrepAttributes_GetZSteps(PyObject *self, PyObject *args)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetZSteps()));
    return retval;
}



PyMethodDef PySurfCompPrepAttributes_methods[SURFCOMPPREPATTRIBUTES_NMETH] = {
    {"Notify", SurfCompPrepAttributes_Notify, METH_VARARGS},
    {"SetSurfaceType", SurfCompPrepAttributes_SetSurfaceType, METH_VARARGS},
    {"GetSurfaceType", SurfCompPrepAttributes_GetSurfaceType, METH_VARARGS},
    {"SetCoordSystem", SurfCompPrepAttributes_SetCoordSystem, METH_VARARGS},
    {"GetCoordSystem", SurfCompPrepAttributes_GetCoordSystem, METH_VARARGS},
    {"SetThetaStart", SurfCompPrepAttributes_SetThetaStart, METH_VARARGS},
    {"GetThetaStart", SurfCompPrepAttributes_GetThetaStart, METH_VARARGS},
    {"SetThetaStop", SurfCompPrepAttributes_SetThetaStop, METH_VARARGS},
    {"GetThetaStop", SurfCompPrepAttributes_GetThetaStop, METH_VARARGS},
    {"SetThetaSteps", SurfCompPrepAttributes_SetThetaSteps, METH_VARARGS},
    {"GetThetaSteps", SurfCompPrepAttributes_GetThetaSteps, METH_VARARGS},
    {"SetPhiStart", SurfCompPrepAttributes_SetPhiStart, METH_VARARGS},
    {"GetPhiStart", SurfCompPrepAttributes_GetPhiStart, METH_VARARGS},
    {"SetPhiStop", SurfCompPrepAttributes_SetPhiStop, METH_VARARGS},
    {"GetPhiStop", SurfCompPrepAttributes_GetPhiStop, METH_VARARGS},
    {"SetPhiSteps", SurfCompPrepAttributes_SetPhiSteps, METH_VARARGS},
    {"GetPhiSteps", SurfCompPrepAttributes_GetPhiSteps, METH_VARARGS},
    {"SetStartRadius", SurfCompPrepAttributes_SetStartRadius, METH_VARARGS},
    {"GetStartRadius", SurfCompPrepAttributes_GetStartRadius, METH_VARARGS},
    {"SetEndRadius", SurfCompPrepAttributes_SetEndRadius, METH_VARARGS},
    {"GetEndRadius", SurfCompPrepAttributes_GetEndRadius, METH_VARARGS},
    {"SetRadiusSteps", SurfCompPrepAttributes_SetRadiusSteps, METH_VARARGS},
    {"GetRadiusSteps", SurfCompPrepAttributes_GetRadiusSteps, METH_VARARGS},
    {"SetXStart", SurfCompPrepAttributes_SetXStart, METH_VARARGS},
    {"GetXStart", SurfCompPrepAttributes_GetXStart, METH_VARARGS},
    {"SetXStop", SurfCompPrepAttributes_SetXStop, METH_VARARGS},
    {"GetXStop", SurfCompPrepAttributes_GetXStop, METH_VARARGS},
    {"SetXSteps", SurfCompPrepAttributes_SetXSteps, METH_VARARGS},
    {"GetXSteps", SurfCompPrepAttributes_GetXSteps, METH_VARARGS},
    {"SetYStart", SurfCompPrepAttributes_SetYStart, METH_VARARGS},
    {"GetYStart", SurfCompPrepAttributes_GetYStart, METH_VARARGS},
    {"SetYStop", SurfCompPrepAttributes_SetYStop, METH_VARARGS},
    {"GetYStop", SurfCompPrepAttributes_GetYStop, METH_VARARGS},
    {"SetYSteps", SurfCompPrepAttributes_SetYSteps, METH_VARARGS},
    {"GetYSteps", SurfCompPrepAttributes_GetYSteps, METH_VARARGS},
    {"SetZStart", SurfCompPrepAttributes_SetZStart, METH_VARARGS},
    {"GetZStart", SurfCompPrepAttributes_GetZStart, METH_VARARGS},
    {"SetZStop", SurfCompPrepAttributes_SetZStop, METH_VARARGS},
    {"GetZStop", SurfCompPrepAttributes_GetZStop, METH_VARARGS},
    {"SetZSteps", SurfCompPrepAttributes_SetZSteps, METH_VARARGS},
    {"GetZSteps", SurfCompPrepAttributes_GetZSteps, METH_VARARGS},
    {NULL, NULL}
};

//
// Type functions
//

static void
SurfCompPrepAttributes_dealloc(PyObject *v)
{
   SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)v;
   if(obj->parent != 0)
       Py_DECREF(obj->parent);
   if(obj->owns)
       delete obj->data;
}

static PyObject *SurfCompPrepAttributes_richcompare(PyObject *self, PyObject *other, int op);
PyObject *
PySurfCompPrepAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "surfaceType") == 0)
        return SurfCompPrepAttributes_GetSurfaceType(self, NULL);
    if(strcmp(name, "Closest") == 0)
        return PyInt_FromLong(long(SurfCompPrepAttributes::Closest));
    if(strcmp(name, "Farthest") == 0)
        return PyInt_FromLong(long(SurfCompPrepAttributes::Farthest));
    if(strcmp(name, "Average") == 0)
        return PyInt_FromLong(long(SurfCompPrepAttributes::Average));

    if(strcmp(name, "coordSystem") == 0)
        return SurfCompPrepAttributes_GetCoordSystem(self, NULL);
    if(strcmp(name, "Cartesian") == 0)
        return PyInt_FromLong(long(SurfCompPrepAttributes::Cartesian));
    if(strcmp(name, "Cylindrical") == 0)
        return PyInt_FromLong(long(SurfCompPrepAttributes::Cylindrical));
    if(strcmp(name, "Spherical") == 0)
        return PyInt_FromLong(long(SurfCompPrepAttributes::Spherical));

    if(strcmp(name, "thetaStart") == 0)
        return SurfCompPrepAttributes_GetThetaStart(self, NULL);
    if(strcmp(name, "thetaStop") == 0)
        return SurfCompPrepAttributes_GetThetaStop(self, NULL);
    if(strcmp(name, "thetaSteps") == 0)
        return SurfCompPrepAttributes_GetThetaSteps(self, NULL);
    if(strcmp(name, "phiStart") == 0)
        return SurfCompPrepAttributes_GetPhiStart(self, NULL);
    if(strcmp(name, "phiStop") == 0)
        return SurfCompPrepAttributes_GetPhiStop(self, NULL);
    if(strcmp(name, "phiSteps") == 0)
        return SurfCompPrepAttributes_GetPhiSteps(self, NULL);
    if(strcmp(name, "startRadius") == 0)
        return SurfCompPrepAttributes_GetStartRadius(self, NULL);
    if(strcmp(name, "endRadius") == 0)
        return SurfCompPrepAttributes_GetEndRadius(self, NULL);
    if(strcmp(name, "radiusSteps") == 0)
        return SurfCompPrepAttributes_GetRadiusSteps(self, NULL);
    if(strcmp(name, "xStart") == 0)
        return SurfCompPrepAttributes_GetXStart(self, NULL);
    if(strcmp(name, "xStop") == 0)
        return SurfCompPrepAttributes_GetXStop(self, NULL);
    if(strcmp(name, "xSteps") == 0)
        return SurfCompPrepAttributes_GetXSteps(self, NULL);
    if(strcmp(name, "yStart") == 0)
        return SurfCompPrepAttributes_GetYStart(self, NULL);
    if(strcmp(name, "yStop") == 0)
        return SurfCompPrepAttributes_GetYStop(self, NULL);
    if(strcmp(name, "ySteps") == 0)
        return SurfCompPrepAttributes_GetYSteps(self, NULL);
    if(strcmp(name, "zStart") == 0)
        return SurfCompPrepAttributes_GetZStart(self, NULL);
    if(strcmp(name, "zStop") == 0)
        return SurfCompPrepAttributes_GetZStop(self, NULL);
    if(strcmp(name, "zSteps") == 0)
        return SurfCompPrepAttributes_GetZSteps(self, NULL);


    // Add a __dict__ answer so that dir() works
    if (!strcmp(name, "__dict__"))
    {
        PyObject *result = PyDict_New();
        for (int i = 0; PySurfCompPrepAttributes_methods[i].ml_meth; i++)
            PyDict_SetItem(result,
                PyString_FromString(PySurfCompPrepAttributes_methods[i].ml_name),
                PyString_FromString(PySurfCompPrepAttributes_methods[i].ml_name));
        return result;
    }

    return Py_FindMethod(PySurfCompPrepAttributes_methods, self, name);
}

int
PySurfCompPrepAttributes_setattr(PyObject *self, char *name, PyObject *args)
{
    PyObject NULL_PY_OBJ;
    PyObject *obj = &NULL_PY_OBJ;

    if(strcmp(name, "surfaceType") == 0)
        obj = SurfCompPrepAttributes_SetSurfaceType(self, args);
    else if(strcmp(name, "coordSystem") == 0)
        obj = SurfCompPrepAttributes_SetCoordSystem(self, args);
    else if(strcmp(name, "thetaStart") == 0)
        obj = SurfCompPrepAttributes_SetThetaStart(self, args);
    else if(strcmp(name, "thetaStop") == 0)
        obj = SurfCompPrepAttributes_SetThetaStop(self, args);
    else if(strcmp(name, "thetaSteps") == 0)
        obj = SurfCompPrepAttributes_SetThetaSteps(self, args);
    else if(strcmp(name, "phiStart") == 0)
        obj = SurfCompPrepAttributes_SetPhiStart(self, args);
    else if(strcmp(name, "phiStop") == 0)
        obj = SurfCompPrepAttributes_SetPhiStop(self, args);
    else if(strcmp(name, "phiSteps") == 0)
        obj = SurfCompPrepAttributes_SetPhiSteps(self, args);
    else if(strcmp(name, "startRadius") == 0)
        obj = SurfCompPrepAttributes_SetStartRadius(self, args);
    else if(strcmp(name, "endRadius") == 0)
        obj = SurfCompPrepAttributes_SetEndRadius(self, args);
    else if(strcmp(name, "radiusSteps") == 0)
        obj = SurfCompPrepAttributes_SetRadiusSteps(self, args);
    else if(strcmp(name, "xStart") == 0)
        obj = SurfCompPrepAttributes_SetXStart(self, args);
    else if(strcmp(name, "xStop") == 0)
        obj = SurfCompPrepAttributes_SetXStop(self, args);
    else if(strcmp(name, "xSteps") == 0)
        obj = SurfCompPrepAttributes_SetXSteps(self, args);
    else if(strcmp(name, "yStart") == 0)
        obj = SurfCompPrepAttributes_SetYStart(self, args);
    else if(strcmp(name, "yStop") == 0)
        obj = SurfCompPrepAttributes_SetYStop(self, args);
    else if(strcmp(name, "ySteps") == 0)
        obj = SurfCompPrepAttributes_SetYSteps(self, args);
    else if(strcmp(name, "zStart") == 0)
        obj = SurfCompPrepAttributes_SetZStart(self, args);
    else if(strcmp(name, "zStop") == 0)
        obj = SurfCompPrepAttributes_SetZStop(self, args);
    else if(strcmp(name, "zSteps") == 0)
        obj = SurfCompPrepAttributes_SetZSteps(self, args);

    if (obj != NULL && obj != &NULL_PY_OBJ)
        Py_DECREF(obj);

    if (obj == &NULL_PY_OBJ)
    {
        obj = NULL;
        PyErr_Format(PyExc_NameError, "name '%s' is not defined", name);
    }
    else if (obj == NULL && !PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "unknown problem with '%s'", name);

    return (obj != NULL) ? 0 : -1;
}

static int
SurfCompPrepAttributes_print(PyObject *v, FILE *fp, int flags)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)v;
    fprintf(fp, "%s", PySurfCompPrepAttributes_ToString(obj->data, "",false).c_str());
    return 0;
}

PyObject *
SurfCompPrepAttributes_str(PyObject *v)
{
    SurfCompPrepAttributesObject *obj = (SurfCompPrepAttributesObject *)v;
    return PyString_FromString(PySurfCompPrepAttributes_ToString(obj->data,"", false).c_str());
}

//
// The doc string for the class.
//
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 5)
static const char *SurfCompPrepAttributes_Purpose = "Attributes for the SurfCompPrep operator.";
#else
static char *SurfCompPrepAttributes_Purpose = "Attributes for the SurfCompPrep operator.";
#endif

//
// Python Type Struct Def Macro from Py2and3Support.h
//
//         VISIT_PY_TYPE_OBJ( VPY_TYPE,
//                            VPY_NAME,
//                            VPY_OBJECT,
//                            VPY_DEALLOC,
//                            VPY_PRINT,
//                            VPY_GETATTR,
//                            VPY_SETATTR,
//                            VPY_STR,
//                            VPY_PURPOSE,
//                            VPY_RICHCOMP,
//                            VPY_AS_NUMBER)

//
// The type description structure
//

VISIT_PY_TYPE_OBJ(SurfCompPrepAttributesType,         \
                  "SurfCompPrepAttributes",           \
                  SurfCompPrepAttributesObject,       \
                  SurfCompPrepAttributes_dealloc,     \
                  SurfCompPrepAttributes_print,       \
                  PySurfCompPrepAttributes_getattr,   \
                  PySurfCompPrepAttributes_setattr,   \
                  SurfCompPrepAttributes_str,         \
                  SurfCompPrepAttributes_Purpose,     \
                  SurfCompPrepAttributes_richcompare, \
                  0); /* as_number*/

//
// Helper function for comparing.
//
static PyObject *
SurfCompPrepAttributes_richcompare(PyObject *self, PyObject *other, int op)
{
    // only compare against the same type 
    if ( Py_TYPE(self) != &SurfCompPrepAttributesType
         || Py_TYPE(other) != &SurfCompPrepAttributesType)
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

    PyObject *res = NULL;
    SurfCompPrepAttributes *a = ((SurfCompPrepAttributesObject *)self)->data;
    SurfCompPrepAttributes *b = ((SurfCompPrepAttributesObject *)other)->data;

    switch (op)
    {
       case Py_EQ:
           res = (*a == *b) ? Py_True : Py_False;
           break;
       case Py_NE:
           res = (*a != *b) ? Py_True : Py_False;
           break;
       default:
           res = Py_NotImplemented;
           break;
    }

    Py_INCREF(res);
    return res;
}

//
// Helper functions for object allocation.
//

static SurfCompPrepAttributes *defaultAtts = 0;
static SurfCompPrepAttributes *currentAtts = 0;

static PyObject *
NewSurfCompPrepAttributes(int useCurrent)
{
    SurfCompPrepAttributesObject *newObject;
    newObject = PyObject_NEW(SurfCompPrepAttributesObject, &SurfCompPrepAttributesType);
    if(newObject == NULL)
        return NULL;
    if(useCurrent && currentAtts != 0)
        newObject->data = new SurfCompPrepAttributes(*currentAtts);
    else if(defaultAtts != 0)
        newObject->data = new SurfCompPrepAttributes(*defaultAtts);
    else
        newObject->data = new SurfCompPrepAttributes;
    newObject->owns = true;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

static PyObject *
WrapSurfCompPrepAttributes(const SurfCompPrepAttributes *attr)
{
    SurfCompPrepAttributesObject *newObject;
    newObject = PyObject_NEW(SurfCompPrepAttributesObject, &SurfCompPrepAttributesType);
    if(newObject == NULL)
        return NULL;
    newObject->data = (SurfCompPrepAttributes *)attr;
    newObject->owns = false;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

///////////////////////////////////////////////////////////////////////////////
//
// Interface that is exposed to the VisIt module.
//
///////////////////////////////////////////////////////////////////////////////

PyObject *
SurfCompPrepAttributes_new(PyObject *self, PyObject *args)
{
    int useCurrent = 0;
    if (!PyArg_ParseTuple(args, "i", &useCurrent))
    {
        if (!PyArg_ParseTuple(args, ""))
            return NULL;
        else
            PyErr_Clear();
    }

    return (PyObject *)NewSurfCompPrepAttributes(useCurrent);
}

//
// Plugin method table. These methods are added to the visitmodule's methods.
//
static PyMethodDef SurfCompPrepAttributesMethods[] = {
    {"SurfCompPrepAttributes", SurfCompPrepAttributes_new, METH_VARARGS},
    {NULL,      NULL}        /* Sentinel */
};

static Observer *SurfCompPrepAttributesObserver = 0;

std::string
PySurfCompPrepAttributes_GetLogString()
{
    std::string s("SurfCompPrepAtts = SurfCompPrepAttributes()\n");
    if(currentAtts != 0)
        s += PySurfCompPrepAttributes_ToString(currentAtts, "SurfCompPrepAtts.", true);
    return s;
}

static void
PySurfCompPrepAttributes_CallLogRoutine(Subject *subj, void *data)
{
    typedef void (*logCallback)(const std::string &);
    logCallback cb = (logCallback)data;

    if(cb != 0)
    {
        std::string s("SurfCompPrepAtts = SurfCompPrepAttributes()\n");
        s += PySurfCompPrepAttributes_ToString(currentAtts, "SurfCompPrepAtts.", true);
        cb(s);
    }
}

void
PySurfCompPrepAttributes_StartUp(SurfCompPrepAttributes *subj, void *data)
{
    if(subj == 0)
        return;

    currentAtts = subj;
    PySurfCompPrepAttributes_SetDefaults(subj);

    //
    // Create the observer that will be notified when the attributes change.
    //
    if(SurfCompPrepAttributesObserver == 0)
    {
        SurfCompPrepAttributesObserver = new ObserverToCallback(subj,
            PySurfCompPrepAttributes_CallLogRoutine, (void *)data);
    }

}

void
PySurfCompPrepAttributes_CloseDown()
{
    delete defaultAtts;
    defaultAtts = 0;
    delete SurfCompPrepAttributesObserver;
    SurfCompPrepAttributesObserver = 0;
}

PyMethodDef *
PySurfCompPrepAttributes_GetMethodTable(int *nMethods)
{
    *nMethods = 1;
    return SurfCompPrepAttributesMethods;
}

bool
PySurfCompPrepAttributes_Check(PyObject *obj)
{
    return (obj->ob_type == &SurfCompPrepAttributesType);
}

SurfCompPrepAttributes *
PySurfCompPrepAttributes_FromPyObject(PyObject *obj)
{
    SurfCompPrepAttributesObject *obj2 = (SurfCompPrepAttributesObject *)obj;
    return obj2->data;
}

PyObject *
PySurfCompPrepAttributes_New()
{
    return NewSurfCompPrepAttributes(0);
}

PyObject *
PySurfCompPrepAttributes_Wrap(const SurfCompPrepAttributes *attr)
{
    return WrapSurfCompPrepAttributes(attr);
}

void
PySurfCompPrepAttributes_SetParent(PyObject *obj, PyObject *parent)
{
    SurfCompPrepAttributesObject *obj2 = (SurfCompPrepAttributesObject *)obj;
    obj2->parent = parent;
}

void
PySurfCompPrepAttributes_SetDefaults(const SurfCompPrepAttributes *atts)
{
    if(defaultAtts)
        delete defaultAtts;

    defaultAtts = new SurfCompPrepAttributes(*atts);
}

